<?php

class gWebsetup extends cGroup 
{
	
	public $showInAdmin = true;
	public $translated = array("name" => "Websetup");

	function __construct(cCms &$cms) {
		parent::__construct($cms);
		$this->defaultView = new cView(array("browse"=>"hotlinks","hotlink"=>"layouts","id"=>"","group"=>"websetup"),$this->defaultView);
		
		$this->hotlinks['synchronize']='Synchronizace SQL';
		$this->hotlinks['setup']='Nastavení';
		$this->hotlinks['templates']='Šablony';
		$this->hotlinks['definitions']='Definice';
	}
	
	
	function getTree($view) {
		return "";
	}
	
	function getLayouts($view) 
	{
		//return "<h1>Lejautky</h1>";
		$fClass = $this->cms->file->loadNode("standard","folder");
		$folder = new $fClass(null, $this->cms);
		$folder->setCustom("customSQL","type='layout'"); 
		$folder->setStandard("name","Layouty");
		return $folder->view($view);
	}
	
	function getHLSelect($name) 
	{
		$hl['newArticles']="group='".$this->getName()."' type='article' ORDER BY created_at DESC";
		$hl['newComments']="group='".$this->getName()."' type='comments' ORDER BY created_at DESC";
		$hl['unpublished']="Koncepty";
		
	}	

	function getLayout($view)
	{
		return $this->cms->tree->getNodeWhere("type='layout' AND group='websetup' LIMIT 1");
	}
	
	function browseHL($view) 
	{
		$class = $this->cms->file->loadNode('websetup',$view->hotlink);
		$node = new $class($this->cms);
		$view->action = 'insert';
		return $node->view($view);
		//return $this->{'getHL'.$view->hotlink}($view);
	}
	
	
	


}

?>